-- GENERATED SPELL FOR [Shadowmoon Darkweaver] --


function spell0_22081(pUnit, Event) --@Immolate,n/a--
pUnit:FullCastSpellOnTarget(11962,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_22081', 17000, 1)
end

function spell1_22081(pUnit, Event) --@Nether Infusion,n/a--
pUnit:FullCastSpellOnTarget(38446,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_22081', 32000, 1)
end

function spell2_22081(pUnit, Event) --@Shadow Bolt,n/a--
pUnit:FullCastSpellOnTarget(9613,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_22081', 3000, 1)
end

function spell3_22081(pUnit, Event) --@Shadowfury,n/a--
pUnit:FullCastSpellOnTarget(35373,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_22081', 3000, 1)
end

function spell4_22081(pUnit, Event) --@Shadowmoon Warlock,n/a--
pUnit:FullCastSpellOnTarget(38442,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_22081', 628, 1)
end

function Sorts_22081(pUnit, Event)
local choix_sorts_22081 = math.random(0, 4)
if choix_sorts_22081 == 0 then
pUnit:RegisterEvent('spell0_22081', 1, 1)
end
if choix_sorts_22081 == 1 then
pUnit:RegisterEvent('spell1_22081', 1, 1)
end
if choix_sorts_22081 == 2 then
pUnit:RegisterEvent('spell2_22081', 1, 1)
end
if choix_sorts_22081 == 3 then
pUnit:RegisterEvent('spell3_22081', 1, 1)
end
if choix_sorts_22081 == 4 then
pUnit:RegisterEvent('spell4_22081', 1, 1)
end
end

function mob22081_Action(pUnit, Event)
pUnit:RegisterEvent('Sorts_22081', math.random(1500, 3000), 1)
end

function mob22081_Leave(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob22081_Kill(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob22081_Die(pUnit, Event)
pUnit:RemoveEvents();
end

RegisterUnitEvent(22081, 1, 'mob22081_Action')
RegisterUnitEvent(22081, 2, 'mob22081_Leave')
RegisterUnitEvent(22081, 3, 'mob22081_Kill')
RegisterUnitEvent(22081, 4, 'mob22081_Die')
